﻿#ifndef MEMSDATA_H
#define MEMSDATA_H

#include <QObject>
#include <qbytearray.h>
#include <qdatetime.h>
#include <qvector.h>

class MEMSData :  public QObject
{
  Q_OBJECT
private:
  enum DataType{
    SourceData=0x00,
    DateTime=0x01
  };
private://property
  QByteArray sourceData;
  QDateTime createTime;
private:
  static int minSize;
public:
  MEMSData(QObject *parent = nullptr);
  MEMSData(const MEMSData& mEMSData);
public:
  QByteArray toByteArray() const;
  static MEMSData fromByteArray(QByteArray data);
  static QVector<MEMSData> fromByteArrayToList(QByteArray data);
  bool isValid() const;
  QString toString() const;
signals:
public://geter and seter
  QByteArray getSourceData() const;
  void setSourceData(const QByteArray sourceData);
  QDateTime getCreateTime() const;
  void setCreateTime(const QDateTime createTime);
  MEMSData &operator=(const MEMSData &);
};

#endif // MEMSDATA_H
